package main

import "fmt"

// @author: JokerBai
// @function: main
// @description: 替换字符串中的值
func main(){
    array := [5]string{"I","am","stupid","and","weak"}
    fmt.Println("old array: ",array)
    for index := range array{
        if array[index] == "stupid"{
            array[index] = "smart"
        }
        if array[index] == "weak" {
            array[index] = "strong"
        }
    }
    fmt.Println("new array: ",array)
}

// 输出：
// old array:  [I am stupid and weak]
// new array:  [I am smart and strong]